<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link rel="stylesheet" type="text/css" href="/res/css/vip.css"/>
    <script src="/res/js/jquery-3.4.1.min.js"></script>
    <script src="/res/js/tools.js"></script>
    <script>
        $(function (){
            $("#tog").on("click",function (){
                let data={
                    vname:$("#Name").val(),
                    vpwd:$("#Pwd").val()
                }
                console.info(data)
                let url="/vipTb/findLogin";
                console.info("123123131");
                $.post(url,data,function (resp){
                    console.info(resp);
                    if (resp.state=="1"){
                        sessionStorage.setItem("herdName",$("#Name").val());
                        console.log($("#Name").val());
                        console.info("进入跳转");
                        console.info(resp.msg)
                        if ($("#Name").val()=='admin'){
                            location.href="/pages/flowerList.html";
                        }else{
                            // sessionStorage.setItem("vname",$("#Name").val());
                            // sessionStorage.setItem("vid",resp.msg);
                            location.href="/index.html";
                        }
                    }else{
                        $("#vNameMsg").text("用户名或密码错误");
                    }
                },"json");
            })
        })
    </script>
</head>
<body>
<fieldset class="open">
    <legend>登录信息</legend>


    <form action="/" method="post">
        <table>
            <tr>
                <td>用户名：</td><td><input type="text" id="Name" name="name" class="so" /></td>
                <td id="vNameMsg"></td>
            </tr>
            <tr>
                <td>密码：</td><td><input type="password" id="Pwd" name="pwd" class="so" /></td>
                <td></td>
            </tr>
            <tr>
                <td><a href="/pages/Regist.html">注册</a></td>
                <td colspan="2"><input type="button" id="tog" value="登录"></td>
            </tr>
        </table>
    </form>
</fieldset>
</body>
</html>